Repository navigation
Harness: dump and stop a run that hangs anywhere, and upload the dump when CI times out - #129
Merged
Merged
Conversation
… when CI times out A hang in the harness's own process, outside a section AH case, ran into the job's time limit with nothing to show: no time limit or dump covered it, and the job ended cancelled, which the upload step (failure only) skipped. A watchdog process now dumps the harness, lists its programs and kills it when no assertion has come for PK_HARNESS_WATCHDOG_MINUTES (2 on CI). Each harness step has its own time limit, the upload runs on cancellation too, the case runner's process listing has a time limit, and its self-check says how a case that ended by itself ended.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent of #127 and #128; merge it first, so their next CI runs have it.
What was wrong
#127's 5.1 Harness job hung in section AH's own checks of its case runner, which run in the harness's own process, not in a case. Only the cases have a time limit and a dump, so nothing caught it. The job ran into its 15-minute limit and ended cancelled, and the upload step (
if: failure()) was skipped. There was no dump, and no way to tell where it hung.Just before the hang, AH's check "a case that can't be stopped is cut off at its time limit" failed because the fresh
powershell.exeended at once with no output, and the message didn't say how it ended.What changed
A watchdog for the harness itself. With
PK_HARNESS_WATCHDOG_MINUTESset (both workflows set 2), the harness starts a watchdog process on its console. Every assertion and skip records that the run is still making progress. If no assertion has come for that long, the watchdog:[FAIL] watchdog: ...with the last assertion;The longest gap between assertions in a CI log is about 19 s. Unset, nothing changes.
Per-step time limits. 14 minutes for each full harness step, 8 for the module sections, 16 for
module.yml's; the harness jobs' limit is now 25 minutes.Upload on cancellation too. The dump upload runs on
failure() || cancelled().Case runner fixes. Its
Get-CimInstancehas a 30 s limit. The "cut off at its time limit" check now gives the exit code and stderr of a case that ended by itself.Code layout.
Write-HarnessDumpmoved to the top of the harness, since the watchdog uses it too.README. The Testing section mentions
PK_HARNESS_WATCHDOG_MINUTES.How it was tested
PK_HARNESS_WATCHDOG_MINUTES=2, as on CI. The full harness passes on 5.1 and 7 (797 assertions each), and-AsModule -Section MODULEpasses on both (309). The watchdog never fired and left no files behind.Get-CimInstancecall (with-OperationTimeoutSec) was checked on its own on both runtimes.timeout-minutescounts as failed or cancelled on GitHub. The upload condition covers both. Seeing it work on CI needs a real hang.